{% extends 'layout.html' %} {% block content %}
<div class="container">
  <div style="margin-bottom: 10px">
    <a class="btn btn-primary" href="/user/list/" name="click_kongge">
      <span class="glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
      返回上一页(空格)
    </a>
  </div>
  
  <div class="panel panel-default">
    <!-- Default panel contents -->
    <div class="panel-heading">
      <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
      要修改修改用户的原本信息
    </div>

    <!-- Table -->
    <table class="table table-bordered">
      <thead>
        <tr>
          <th>ID</th>
          <th>姓名</th>
          <th>密码</th>
          <th>年龄</th>
          <th>余额</th>
          <th>入职时间</th>
          <th>性别</th>
          <th>所属部门</th>
          {% comment %} <th>操作</th> {% endcomment %}
        </tr>
      </thead>
      <tbody>
        <th>{{ del_to_html.id }}</th>
        <td>{{ del_to_html.name }}</td> 
        <td>{{ del_to_html.password }}</td>
        <td>{{ del_to_html.age }}</td> 
        <td>{{ del_to_html.account }}</td>
        <td>{{ del_to_html.create_time|date:"Y-m-d" }}</td>
        <td name="change_name_gender">{{ del_to_html.get_gender_display }}</td>
        <td name="change_name_depart">{{ del_to_html.depart.title }}</td>
      </tbody>
    </table>
  </div>

  {% if error %}
  {% comment %} 根据这个部分判断一下有没有报错然后搞一下就好了  alert  {% endcomment %}
  <a name="error_msg_change"></a>
  {% endif %}

  {% if success %}
  {% comment %} 根据这个部分判断一下有没有报错然后搞一下就好了  alert  {% endcomment %}
  <a name="success_msg_change"></a>
  {% endif %}

  <div class="panel-body">
    <form method="post">
        {% csrf_token %}
        <div class="form-group">
            <label>姓名</label>
            <input type="text" class="form-control" placeholder="姓名" name="user" value={{ del_to_html.name }} />
        </div>

        <div class="form-group">
            <label>密码</label>
            <input type="text" class="form-control" placeholder="密码" name="pwd"      value = {{ del_to_html.password }}  />
        </div>

        <div class="form-group">
            <label>年龄</label>
            <input type="text" class="form-control" placeholder="年龄" name="age" value = {{ del_to_html.age }} />
        </div>

        <div class="form-group">
            <label>余额</label>
            <input type="text" class="form-control" placeholder="余额" name="ac"  value = {{ del_to_html.account }} />
        </div>


        <div class="form-group">
            <label>入职时间</label>
            <input type="text" class="form-control" placeholder="入职时间" name="ctime"      value = {{ del_to_html.create_time|date:"Y-m-d" }} />
        </div>

        <div class="form-group">
            <label>性别</label>
            <select class="form-control" name="gd" id="select">
                {% for item in gender_choices %}
                    <option  value="{{ item.0 }}" name="select_gender">{{ item.1 }}</option>
                {% endfor %}
            </select>
        </div>

        <div class="form-group">
            <label>部门</label>
            <select class="form-control" name="dp" id ="select_depart">
                {% for item in depart_list %}
                    <option value="{{ item.id }}">{{ item.title }}</option>
                {% endfor %}
            </select>
        </div>

        <button type="submit" class="btn btn-primary" name="set_return_13">提 交(回车)</button>
    </form>

</div>
</div>
{% endblock %}
